<?php
/**
* @desc 订单表单处理
* @author kevin.wang
* @date 2015-01-01 12:00:00
**/
class OrderForm extends BaseForm
{
	public $total_amount;
	public $order_status;
	public $pay_status;
	public $is_travel;
	public $travel_date;
	public $order_date;
	public $order_expire;
	//表单规则
	public function rules()
	{
		return array(
			array('total_amount, order_status, pay_status, is_travel, travel_date, order_date, order_expire', 'required', 'message'=>'必填字段不能为空'),
			array('order_status, pay_status, total_amount', 'numerical', 'message'=>'订单状态、支付状态、订单金额必须为数字'),
			array('is_travel', 'boolean', 'message'=>'是否出游为布尔值')
		);
	}
	//写入数据
	/*public function saveData(){
		$model = new Ptravel;
		$userInfo = json_decode(Yii::app()->session['userinfo'], true);
		$data = $this->attributes;
		$data['author'] = $userInfo['username'];
		return $model->insertPtravel($data);
	}*/
	//修改数据
	public function editData($id){
		$model = new Order;
		return $model->editMainOrder($id, $this->attributes);
	}
}
